package com.goodving.guli.bt.ui;

import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.goodving.guli.R;
import com.goodving.guli.bt.profile.scale.GuliLog;
import com.goodving.guli.view.C4005t;


public class DimPanelBottomBar extends FrameLayout {
    private static final String f10391a = "dark";
    private final TextView f10392b;
    private final TextView f10393c;

    public DimPanelBottomBar(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public DimPanelBottomBar(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        LayoutInflater.from(context).inflate(R.layout.dialog_bottom_bar, this);
        this.f10393c = (TextView) findViewById(R.id.left_button);
        this.f10392b = (TextView) findViewById(R.id.right_button);
        View findViewById = findViewById(R.id.bottom_bar_frame);
        View findViewById2 = findViewById(R.id.bottom_bar_frame_split);
        TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C4005t.DimPanelFragmentBottomBar);
        CharSequence string = obtainStyledAttributes.getString(C4005t.DimPanelFragmentBottomBar_left_text);
        CharSequence string2 = obtainStyledAttributes.getString(C4005t.DimPanelFragmentBottomBar_right_text);
        int color = obtainStyledAttributes.getColor(C4005t.DimPanelFragmentBottomBar_left_text_color, getResources().getColor(R.color.main_ui_title_color));
        int color2 = obtainStyledAttributes.getColor(C4005t.DimPanelFragmentBottomBar_right_text_color, getResources().getColor(R.color.main_ui_title_color));
        String string3 = obtainStyledAttributes.getString(C4005t.DimPanelFragmentBottomBar_show_style);
        GuliLog.tracePrintInfo(getClass().getName(), "left:" + string + ", right:" + string2);
        int i2 = R.drawable.click_btn_bg_3;
        int i3 = R.drawable.click_btn_bg_3_left_round;
        int i4 = R.drawable.click_btn_bg_3_right_round;
        if (f10391a.equals(string3)) {
            i2 = R.drawable.click_btn_bg;
            i3 = R.drawable.click_btn_bg_left_round;
            i4 = R.drawable.click_btn_bg_right_round;
            findViewById2.setBackgroundResource(R.color.content_color);
        }
        if (TextUtils.isEmpty(string)) {
            this.f10393c.setVisibility(View.GONE);
        } else {
            this.f10393c.setText(string);
            this.f10393c.setVisibility(View.VISIBLE);
            this.f10393c.setBackgroundResource(i2);
        }
        if (TextUtils.isEmpty(string2)) {
            this.f10392b.setVisibility(View.GONE);
        } else {
            this.f10392b.setText(string2);
            this.f10392b.setVisibility(View.VISIBLE);
            this.f10392b.setBackgroundResource(i2);
        }
        if (TextUtils.isEmpty(string) || TextUtils.isEmpty(string2)) {
            findViewById2.setVisibility(View.GONE);
            findViewById.setBackgroundResource(R.color.trans);
        } else {
            findViewById2.setVisibility(View.VISIBLE);
            findViewById.setBackgroundResource(i2);
            this.f10392b.setBackgroundResource(i4);
            this.f10393c.setBackgroundResource(i3);
        }
        this.f10393c.setTextColor(color);
        this.f10392b.setTextColor(color2);
        obtainStyledAttributes.recycle();
    }

    public View m14979a() {
        return this.f10393c;
    }

    public void m14980a(int i) {
        this.f10393c.setTextColor(i);
    }

    public void m14981a(String str) {
        this.f10393c.setText(str);
    }

    public View m14982b() {
        return this.f10392b;
    }

    public void m14983b(int i) {
        this.f10392b.setTextColor(i);
    }

    public void m14984b(String str) {
        this.f10392b.setText(str);
    }
}
